package com.example.design.a.builder;

/**
 * 具体建造者
 */
public class ComputerDirector {

    /**
     * 抽象建造者对象
     */
    private ComputerBuilder computerBuilder;

    public ComputerDirector(ComputerBuilder builder) {
        this.computerBuilder = builder;
    }

    public Computer getComputer(){
        computerBuilder.buildKeyBoard();
        computerBuilder.buildMouse();
        computerBuilder.buildScreen();

        return computerBuilder.getComputer();
    }
}
